

	

** CENSUS WAGE DISTRIBUTION 
 
use  hourly_wage_CENSUS2000, clear 
		
	qui su monthlyinc if  indgen==10 & monthlyinc >0  ,d
	g upper = r(p95) 
	g lower= r(p5)
	
	su hourly_wage  if indgen==10 & hourly_wage  >0  & monthlyinc < upper ,d
	mat define tableDIST_cens =[ r(p10)\ r(p50) \ r(mean) \r(p90)]

	
	kdensity  hourly_wage  if  indgen	==10 & hourly_wage  >0  & monthlyinc <  upper   , n(300) gen(w_cens d_cens ) nograph

	tempvar x
	 egen  `x'=  rank( w_cens ), unique
	tsset  `x'
	tssmooth ma d_cens_smoo  =  d_cens   ,  window(2 1 2)
	
	keep if w_cens!=. 
	keep w_cens d_cens_smoo d_cens

	tempfile temp1 
	save `temp1', replace

** ENOE WAGE DISTRIBUTION 
	
use hourly_wage_ENOE, clear 
	
	
	su labincome_month  if   agr_w==1 & labincome_month >0,d 
	g upper= r(p95)
	
	*drop outliers 
	keep  if labincome_month < upper 

	su   hw02, d 
	mat define tableDIST_lfs =[ r(p10)\ r(p50) \ r(mean) \r(p90)]

	kdensity   hw02    , n(300) gen(w_lfs d_lfs ) nograph
	tempvar x
	 egen  `x'=  rank( w_lfs ), unique
	tsset  `x'
	tssmooth ma d_lfs_smoo  =  d_lfs   ,  window(2 1 2)
	
	keep if w_lfs!=. 
	keep w_lfs  d_lfs_smoo d_lfs
	
	tempfile temp2
	save `temp2', replace
	
	
** MXFLS WAGE DISTRIBUTION 

	use  MxFLS_final , clear		
	
		** STAT DESC = hourly wages
		g w_cens=.
		g w_lfs=. 
		merge m:1  w_cens using `temp1' 
		drop _m
		merge m:1  w_lfs using  `temp2'
		drop _m
		 
			g hourly_wage02 =  INC_MONTH02/(4.5*hourLW02) 
			
			qui su INC_MONTH02 if  (  workLW_agrw02==1) &  INC_MONTH02 >0   ,d 
			g upper= r(p95)
			g lower= r(p5)

			su hourly_wage02 if  (  workLW_agrw02==1) &  hourly_wage02>0 &  INC_MONTH02<upper &  INC_MONTH02>lower ,d 
			mat define tableDIST_mxls =[ r(p10)\ r(p50) \ r(mean) \r(p90)]

			
			kdensity  hourly_wage02  if  (  workLW_agrw02==1) &  hourly_wage02>0 &  INC_MONTH02<upper &  INC_MONTH02>lower  ,  n(300) gen(w_mxfls d_mxfls ) nograph

		 tempvar x
		 egen  `x'=  rank( w_mxfls ), unique
		tsset  `x'
		tssmooth ma d_mxfls_smoo  =  d_mxfls   ,  window(2 1 2)
		
					
*TABLE DENSITY AGRI WAGES

	mat def tableDIST =	[tableDIST_mxls, tableDIST_cens,tableDIST_lfs  ]
	matrix colnames tableDIST  = MXLS CENSUS LFS
	matrix rownames tableDIST  = p10 Median average p90

	mat list tableDIST 



* DENSITY AGRI WAGES
	

	tw (line  d_mxfls_smoo w_mxfls if  w_mxfls <22 ,sort lpattern(shortdash) lcolor(gs3) ) ///
	(line  d_cens_smoo w_cens if  w_cens <22 ,sort lpattern(solid) lcolor(gs10) )  ///
	(line  d_lfs_smoo w_lfs if  w_lfs <22 ,sort lpattern( longdash_dot ) lcolor(gs6) ) ///
	, ytitle(Density) xtitle(Agricultural hourly wage) ///
	legend(  si(small)     order (1 "MxFLS survey" 2  "Population Census" 3 "Labor force survey" ) ) ///
	ylab(, angle(horizontal)  ) 	graphregion(color(white) )	

	


